package com.lq.schoolshop.dao;

import com.lq.schoolshop.pojo.CategoryType;
import com.lq.schoolshop.pojo.Expand.CategoryTypeAndGoods;
import com.lq.schoolshop.pojo.Goods;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author
 * @Date2021/1/23 14:46
 * @Version V1.0
 *  外卖详情页的
 **/
public interface CategoryTypeMapper {
    //查询全部商品种类、商品、店铺信息
    @Select("SELECT categorytype.id AS cid,categorytype.name AS cname,goods.id AS gid,goods.name AS gname,COUNT,price,image,sellcount,goods.detail AS gdetail,store.id AS sid,store.name AS sname,icon,backimage,store.detail AS sdetail FROM categorytype,goods,store WHERE  categorytype.id=goods.categorytype AND goods.storeid=store.id")
    List<CategoryTypeAndGoods> selByAll();

    //查询全部分类
    @Select("SELECT * FROM categorytype")
    List<CategoryType> selcategorytypeAll();

    //根据分类ID 查询商品信息
    @Select("SELECT * FROM goods WHERE categorytype=#{categorytype}")
    List<Goods> selgoodsByCategoryId(int categorytype);

}
